for /F %%i in ('git rev-parse --short HEAD') do ( set commitid=%%i)
for /F %%i in ('git rev-list --tags --max-count=1') do (set last_tag_commit_id=%%i)
for /F %%i in ('git describe --tags %last_tag_commit_id%') do (set last_tag=%%i)
echo commitid=%commitid%
echo last_tag=%last_tag%
echo build_time=%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%
set build_time=%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%
rem goversioninfo  -64 -platform-specific
go build -ldflags "-w -s -H windowsgui -X main.Commit=%commitid% -X main.Version=%last_tag% -X 'main.BuildTime=%build_time%'" -o ebookdl_ui.exe
copy ebookdl_ui.exe ..\
